<script setup>
import DiscordPicker from 'vue3-discordpicker'
import {ref} from 'vue'
import useStore from '../../../../store'
const { useLogin,useData } = useStore()

let commentValue = ref('')


let value = ref('')
const setEmoji = (emoji) => {
      console.log(emoji)
      commentValue.value += emoji
    }

</script>
<template>
   <div class="comment">
    <div class="comment-top">
      <div class="comment-szie">评论</div>
      <div class="strip">共1234条评论</div>
    </div>
    <div class="commentframe">
      <div class="userpng">
        <img :src="useData.userdata.avatarUrl" alt="" v-if="useLogin.cookie">
      </div>
      <div class="arer">
        <textarea class="u-txt" placeholder="评论" v-model="commentValue"></textarea>
        <span class="arrclr"></span>
        <div class="kongj">
          <div class="eimj">
            <div class="picke">
            <discord-picker
            :value="value"
            gif-format="md"
            @update:value="value = $event"
            @emoji="setEmoji"
          />
        </div>
        <span class="aite"></span>
          </div>
          <div class="commenthd">
            <div class="titlectc">{{commentValue.length}}</div>
            <div class="btn">评论</div>
          </div>
        </div>
      </div>
    </div>
   


  </div>
</template>
<style lang="less" scoped>
textarea{
	border:none;
	outline: none;
	resize: none;
}

.comment {
  margin-top: 40px;
  .comment-top {
    display: flex;
    height: 33px;
    border-bottom: 2px solid #c20c0c;
    .comment-szie {
      font-size: 20px;
    }
    .strip {
      margin: 9px 0 0 20px;
      color: #666;
      font-size: 12px;
    }

  }
  .commentframe {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    .userpng {
      width: 50px;
      height: 50px;
      background: red;
      margin-right: -100px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .arer {
      position: relative;
    .u-txt {
      width: 578px;
      height: 63px;
      padding: 5px 6px 6px;
      border: 1px solid #cdcdcd;
      border-radius: 2px;
      line-height: 19px;
      box-sizing: content-box;
      font-size: 14px;
    }
      .arrclr {
        position: absolute;
        top: 21px;
        left: -5px;
        width: 10px;
        height: 10px;
        background: #fff;
        border-left: 1px solid #cdcdcd;
        border-bottom: 1px solid #cdcdcd;
        transform: rotate(41deg);
      }
      .kongj {
        display: flex;
        justify-content: space-between;
        .eimj {
          display: flex;
          .picke {
            margin-left: -10px;
            margin-top: -10px;
          }
          .aite {
            margin-top: 8px;
            margin-left: 10px;
            display: inline-block;
            width: 18px;
            height: 18px;
            background-position: -60px -490px !important;
            background: url(	https://s2.music.126.net/style/web2/img/icon.png?2338ee0dbf0fdb085567d7f5ada823a5) no-repeat 0 9999px;
            &:hover {
              cursor: pointer;
            }
          }
        }
        .commenthd {
          display: flex;
          margin-top: 5px;
          .titlectc {
            font-size: 12px;
            color: #999;
            margin-right: 10px;
            line-height: 25px;
          }
          .btn {
            width: 46px;
            height: 25px;
            background-position: -84px -64px !important;
            color: #fff;
            text-align: center;
            line-height: 25px;
            background: url(https://s2.music.126.net/style/web2/img/button.png?6627bbab3fa58204bb7f7454a8a884d6) no-repeat 0 9999px;
            &:hover {
              cursor: pointer;
            }
            font-size: 12px;
          }
        }
      }

    }
  }
}
/deep/ .vue3-emojipicker .right-0 {
    right: -42px !important;
}
</style>